using System.ComponentModel.DataAnnotations;

namespace MediPlatform.Read.Api.Models
{
    /// <summary>
    /// 问诊单查询请求模型
    /// </summary>
    public class ConsultationOrderQueryRequest
    {
        /// <summary>
        /// 患者姓名或手机号
        /// </summary>
        public string? PatientNameOrPhone { get; set; }

        /// <summary>
        /// 问诊状态：0-待支付, 1-进行中, 2-已完成, 3-已取消, 4-已退诊, null-全部
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 问诊方式：1-视频问诊, 2-电话问诊, 3-图文问诊, 4-极速电话, 5-复诊开药, null-全部
        /// </summary>
        public int? ConsultationType { get; set; }

        /// <summary>
        /// 问诊来源：1-视频问诊, 2-电话问诊, 3-图文问诊, 4-极速图文, 5-极速电话, null-全部
        /// </summary>
        public int? Source { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        [Range(1, int.MaxValue)]
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小
        /// </summary>
        [Range(1, 100)]
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 问诊单列表项响应模型
    /// </summary>
    public class ConsultationOrderListItem
    {
        /// <summary>
        /// 问诊单ID
        /// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// 问诊单编号
        /// </summary>
        public string? OrderNo { get; set; }

        /// <summary>
        /// 提交问诊时间
        /// </summary>
        public DateTime? SubmitTime { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        public string? PatientName { get; set; }

        /// <summary>
        /// 患者手机号
        /// </summary>
        public string? PatientPhone { get; set; }

        /// <summary>
        /// 科室名称
        /// </summary>
        public string? DepartmentName { get; set; }

        /// <summary>
        /// 医生姓名
        /// </summary>
        public string? DoctorName { get; set; }

        /// <summary>
        /// 问诊方式
        /// </summary>
        public string? ConsultationTypeText { get; set; }

        /// <summary>
        /// 问诊来源
        /// </summary>
        public string? SourceText { get; set; }

        /// <summary>
        /// 问诊费
        /// </summary>
        public decimal? Fee { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 订单状态文本
        /// </summary>
        public string? StatusText { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedAt { get; set; }
    }

    /// <summary>
    /// 问诊单分页响应模型
    /// </summary>
    public class ConsultationOrderPagedResponse
    {
        /// <summary>
        /// 问诊单列表
        /// </summary>
        public List<ConsultationOrderListItem> Items { get; set; } = new();

        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage { get; set; }

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; }
    }

    /// <summary>
    /// 问诊单详情响应模型
    /// </summary>
    public class ConsultationOrderDetailResponse
    {
        /// <summary>
        /// 问诊单基本信息
        /// </summary>
        public ConsultationOrderInfo OrderInfo { get; set; } = new();

        /// <summary>
        /// 问诊记录
        /// </summary>
        public ConsultationRecordInfo? RecordInfo { get; set; }

        /// <summary>
        /// 问诊评价
        /// </summary>
        public ConsultationReviewInfo? ReviewInfo { get; set; }
    }

    /// <summary>
    /// 问诊单基本信息
    /// </summary>
    public class ConsultationOrderInfo
    {
        /// <summary>
        /// 问诊单ID
        /// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// 问诊单编号
        /// </summary>
        public string? OrderNo { get; set; }

        /// <summary>
        /// 患者ID
        /// </summary>
        public long? PatientId { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        public string? PatientName { get; set; }

        /// <summary>
        /// 患者手机号
        /// </summary>
        public string? PatientPhone { get; set; }

        /// <summary>
        /// 医生ID
        /// </summary>
        public long? DoctorId { get; set; }

        /// <summary>
        /// 医生姓名
        /// </summary>
        public string? DoctorName { get; set; }

        /// <summary>
        /// 医院ID
        /// </summary>
        public long? HospitalId { get; set; }

        /// <summary>
        /// 医院名称
        /// </summary>
        public string? HospitalName { get; set; }

        /// <summary>
        /// 科室ID
        /// </summary>
        public long? DepartmentId { get; set; }

        /// <summary>
        /// 科室名称
        /// </summary>
        public string? DepartmentName { get; set; }

        /// <summary>
        /// 问诊类型
        /// </summary>
        public int? ConsultationType { get; set; }

        /// <summary>
        /// 问诊类型文本
        /// </summary>
        public string? ConsultationTypeText { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 订单状态文本
        /// </summary>
        public string? StatusText { get; set; }

        /// <summary>
        /// 预约时间
        /// </summary>
        public DateTime? AppointmentTime { get; set; }

        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime? SubmitTime { get; set; }

        /// <summary>
        /// 问诊费
        /// </summary>
        public decimal? Fee { get; set; }

        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal? DiscountAmount { get; set; }

        /// <summary>
        /// 实际支付金额
        /// </summary>
        public decimal? ActualPayment { get; set; }

        /// <summary>
        /// 支付方式
        /// </summary>
        public string? PaymentMethod { get; set; }

        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime? PaymentTime { get; set; }

        /// <summary>
        /// 退款金额
        /// </summary>
        public decimal? RefundAmount { get; set; }

        /// <summary>
        /// 退款时间
        /// </summary>
        public DateTime? RefundTime { get; set; }

        /// <summary>
        /// 取消原因
        /// </summary>
        public string? CancelReason { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedAt { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdatedAt { get; set; }
    }

    /// <summary>
    /// 问诊记录信息
    /// </summary>
    public class ConsultationRecordInfo
    {
        /// <summary>
        /// 记录ID
        /// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// 问诊单ID
        /// </summary>
        public long? OrderId { get; set; }

        /// <summary>
        /// 病情描述
        /// </summary>
        public string? Symptoms { get; set; }

        /// <summary>
        /// 既往病史
        /// </summary>
        public string? MedicalHistory { get; set; }

        /// <summary>
        /// 诊断结果
        /// </summary>
        public string? Diagnosis { get; set; }

        /// <summary>
        /// 治疗建议
        /// </summary>
        public string? TreatmentAdvice { get; set; }

        /// <summary>
        /// 处方ID
        /// </summary>
        public long? PrescriptionId { get; set; }

        /// <summary>
        /// 问诊时长（秒）
        /// </summary>
        public int? Duration { get; set; }

        /// <summary>
        /// 问诊时长文本
        /// </summary>
        public string? DurationText { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedAt { get; set; }
    }

    /// <summary>
    /// 问诊评价信息
    /// </summary>
    public class ConsultationReviewInfo
    {
        /// <summary>
        /// 评价ID
        /// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// 问诊单ID
        /// </summary>
        public long? OrderId { get; set; }

        /// <summary>
        /// 患者ID
        /// </summary>
        public long? PatientId { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        public string? PatientName { get; set; }

        /// <summary>
        /// 医生ID
        /// </summary>
        public long? DoctorId { get; set; }

        /// <summary>
        /// 医生姓名
        /// </summary>
        public string? DoctorName { get; set; }

        /// <summary>
        /// 评分
        /// </summary>
        public int? Rating { get; set; }

        /// <summary>
        /// 评分文本
        /// </summary>
        public string? RatingText { get; set; }

        /// <summary>
        /// 评价内容
        /// </summary>
        public string? Comment { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedAt { get; set; }
    }

    /// <summary>
    /// 问诊单统计响应模型
    /// </summary>
    public class ConsultationOrderStatisticsResponse
    {
        /// <summary>
        /// 总数量
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 待支付数量
        /// </summary>
        public int PendingPaymentCount { get; set; }

        /// <summary>
        /// 进行中数量
        /// </summary>
        public int InProgressCount { get; set; }

        /// <summary>
        /// 已完成数量
        /// </summary>
        public int CompletedCount { get; set; }

        /// <summary>
        /// 已取消数量
        /// </summary>
        public int CancelledCount { get; set; }

        /// <summary>
        /// 已退诊数量
        /// </summary>
        public int RefundedCount { get; set; }
    }
} 